package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.CartonApplyTemporaryConMapper;
import com.ruoyi.consume.domain.CartonApplyTemporaryCon;
import com.ruoyi.consume.service.ICartonApplyTemporaryConService;

/**
 * 纸箱临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class CartonApplyTemporaryConServiceImpl implements ICartonApplyTemporaryConService
{
    @Autowired
    private CartonApplyTemporaryConMapper cartonApplyTemporaryConMapper;

    /**
     * 查询纸箱临时领用
     *
     * @param cartonApplyTemporaryId 纸箱临时领用ID
     * @return 纸箱临时领用
     */
    @Override
    public CartonApplyTemporaryCon selectCartonApplyTemporaryById(Long cartonApplyTemporaryId)
    {
        return cartonApplyTemporaryConMapper.selectCartonApplyTemporaryById(cartonApplyTemporaryId);
    }

    /**
     * 查询纸箱临时领用列表
     *
     * @param cartonApplyTemporaryCon 纸箱临时领用
     * @return 纸箱临时领用
     */
    @Override
    public List<CartonApplyTemporaryCon> selectCartonApplyTemporaryList(CartonApplyTemporaryCon cartonApplyTemporaryCon)
    {
        return cartonApplyTemporaryConMapper.selectCartonApplyTemporaryList(cartonApplyTemporaryCon);
    }

    /**
     * 新增纸箱临时领用
     *
     * @param cartonApplyTemporaryCon 纸箱临时领用
     * @return 结果
     */
    @Override
    public int insertCartonApplyTemporary(CartonApplyTemporaryCon cartonApplyTemporaryCon)
    {
        cartonApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return cartonApplyTemporaryConMapper.insertCartonApplyTemporary(cartonApplyTemporaryCon);
    }

    /**
     * 修改纸箱临时领用
     *
     * @param cartonApplyTemporaryCon 纸箱临时领用
     * @return 结果
     */
    @Override
    public int updateCartonApplyTemporary(CartonApplyTemporaryCon cartonApplyTemporaryCon)
    {
        cartonApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return cartonApplyTemporaryConMapper.updateCartonApplyTemporary(cartonApplyTemporaryCon);
    }

    /**
     * 批量删除纸箱临时领用
     *
     * @param cartonApplyTemporaryIds 需要删除的纸箱临时领用ID
     * @return 结果
     */
    @Override
    public int deleteCartonApplyTemporaryByIds(Long[] cartonApplyTemporaryIds)
    {
        return cartonApplyTemporaryConMapper.deleteCartonApplyTemporaryByIds(cartonApplyTemporaryIds);
    }

    /**
     * 删除纸箱临时领用信息
     *
     * @param cartonApplyTemporaryId 纸箱临时领用ID
     * @return 结果
     */
    @Override
    public int deleteCartonApplyTemporaryById(Long cartonApplyTemporaryId)
    {
        return cartonApplyTemporaryConMapper.deleteCartonApplyTemporaryById(cartonApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param cartonApplyTemporaryCon 纸箱临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(CartonApplyTemporaryCon cartonApplyTemporaryCon){
        return cartonApplyTemporaryConMapper.updateAmount(cartonApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param cartonApplyTemporaryId 纸箱临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long cartonApplyTemporaryId){
        return cartonApplyTemporaryConMapper.updateConsumeStatus(cartonApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param cartonApplyTemporaryId 纸箱临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long cartonApplyTemporaryId){
        return cartonApplyTemporaryConMapper.updateApprovalStatus(cartonApplyTemporaryId);
    }
}
